﻿using System.Collections.Generic;
using Devonline.Entity;

namespace Web.Utility
{
    public class MessageTools
    {
        private static Dictionary<string, Message<string>> _messages = new Dictionary<string, Message<string>>();

        internal static void OnReceive(Message<string> message)
        {
            _messages.Add(message.Id, message);
        }

        internal Message<string> Get(string id)
        {
            if (_messages.ContainsKey(id))
            {
                return _messages[id];
            }

            return null;
        }
    }
}
